from fastapi.responses import JSONResponse


class ApiResponse:
    @classmethod
    def success(cls, data: dict = None):
        return JSONResponse(
            status_code=200,
            content={
                "code": 200,
                "message": "success",
                "data": data
            }
        )

    @classmethod
    def fail(cls, message: str):
        return JSONResponse(
            status_code=200,
            content={
                "code": -1,
                "message": message,
                "data": None
            }
        )
